//
//  MYGHUD.swift
//  MYGrow
//
//  Created by 小火科技 on 2024/3/4.
//

import Toast_Swift
import UIKit

struct MMYGHUD {
    
    static func showTimeToast(_ view: UIView? = UIViewController.currentViewController?.view, text: String, duration: TimeInterval = 3, completeHandle: (()->Void)? = nil) {
        view?.makeToast(text, duration: duration,  position: .center,completion: { didTap in
            completeHandle?()
        })
    }
    
    
    static func showToast(_ view: UIView? = UIViewController.currentViewController?.view, text: String, completeHandle: (()->Void)? = nil) {
        view?.makeToast(text, position: .center, completion: { didTap in
            completeHandle?()
        })
    }
    
    static func hidToast(_ view: UIView? = UIViewController.currentViewController?.view) {
        view?.hideToast()
    }
}

